<?php
namespace app\backend\validate;

use think\Validate;

class Category extends Validate
{
    protected $rule = [
        'pid' => 'require',
        'category_id' => 'require',
        'category_name' => 'require',
        'category_text' => 'require',
    ];

    protected $message = [
        'pid.require' => '请选择所属栏目',
        'category_id.require' => '栏目id不能为空',
        'category_name.require' => '请输入栏目名',
        'category_text.require' => '请输入栏目简介'
    ];

    protected $scene = [
        'create' => ['pid', 'category_name', 'category_text'],
        'read' => ['category_id'],
        'update' => ['category_id', 'category_name', 'category_text']
    ];
}